import 'package:app/services/address.dart';
import 'package:app/services/dio_manager.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

class CreateFolderController extends GetxController{


  TextEditingController editingController = TextEditingController();

  requestDataCreate({var folder_id = 0})async{
    var params = {
      'name':editingController.text,
      'description':editingController.text,
      'folder_id':folder_id,
    };
    var json = await DioManager().kkRequest(Address.documentFolderCreate,bodyParams: params);
    if(json['errmsg']=='ok'){
      Get.back(result: 'refresh');
    }

    BotToast.showText(text: json['message']);

    update();

  }


  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
  }
}